package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.undertow.util.BadRequestException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @Author lyh
 * @Date 2024/12/2 22:21
 */
@RestController("operationAgencyCertificationAuditController")
@RequestMapping("/operation/agency-certification-audit")
@Api(tags = "机构认证审核信息相关接口")
public class AgencyCertificationAuditController {
    @Autowired
    private IAgencyCertificationAuditService agencyCertificationAuditService;

    @GetMapping("/page")
    @ApiOperation("审核机构认证分页查询")
    public PageResult<AgencyCertificationAuditResDTO> getPage(AgencyCertificationAuditPageQueryReqDTO dto){
        return agencyCertificationAuditService.Page(dto);
    }
    @PutMapping("/audit/{id}")
    @ApiOperation("审核机构认证信息")
    public void audit(@PathVariable("id") Long id,@RequestParam("certificationStatus") Integer certificationStatus,@RequestParam("rejectReason") String rejectReason) throws BadRequestException {
        agencyCertificationAuditService.auditcertification(id,certificationStatus,rejectReason);
    }
}